﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="propertyDetail.aspx.vb" Inherits="GozoFarmhouses.propertyDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">

    <section class="banner">
        <img src="Images/addPropertBanner.jpg" />
    </section>
    
    <section class="propertyDetail"> 
        <div class="row">

            <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
                <ItemTemplate>
                    <div class="large-8 column">

                        <div class="gallery">
                            <img src="<%# Eval("property_image_1")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/> 
                        </div>
                        <div class="galleryThumbs">
                            <img src="<%# Eval("property_image_1")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/> 
                            <img src="<%# Eval("property_image_2")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/>
                            <img src="<%# Eval("property_image_3")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/>
                            <img src="<%# Eval("property_image_4")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/> 
                        </div>

                        <div class="prop_info">
                            <h1><%# Eval("property_name")%></h1>

                            <div class="row">
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Rate</span><span class="right">&euro; <%# Eval("property_rate")%> p/m</span></div></div>
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Bathrooms</span><span class="right"><%# Eval("property_bathrooms")%></span></div></div>
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Bedrooms</span><span class="right"><%# Eval("property_bedrooms")%></span></div></div>
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Square Footage</span><span class="right"><%# Eval("property_square_ft")%>sqft</span></div></div>
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Property Type</span><span class="right"><%# Eval("property_type")%></span></div></div>
                                 <div class="large-6 column"><div class="prop_holder"><span class="label">Car Garage</span><span class="right"><%# Eval("property_car_garage")%></span></div></div>

                                 <div class="large-12 column"><div class="desc"><%# Eval("property_description")%></div></div>

                            </div>

                            <div class="row"> 
                                <div class="large-12 column">
                                    <div class="social">
                                        <!-- AddThis Button BEGIN -->
                                        <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                                        <a class="addthis_button_preferred_1"></a>
                                        <a class="addthis_button_preferred_2"></a>
                                        <a class="addthis_button_preferred_3"></a>
                                        <a class="addthis_button_preferred_4"></a>
                                        <a class="addthis_button_compact"></a>
                                        <a class="addthis_counter addthis_bubble_style"></a>
                                        </div>
                                        <script type="text/javascript">var addthis_config = { "data_track_addressbar": true };</script>
                                        <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-527a533d6b8fba74"></script>
                                        <!-- AddThis Button END -->
                                    </div>
                                </div>

                            </div>

                        </div>
                    </div>

                </ItemTemplate>
            </asp:ListView>

            <asp:ListView ID="ListView2" runat="server" DataSourceID="SqlDataSource1">
                 <ItemTemplate>
                     <div class="large-4 column">
                        <div class="map">
                            <h3>MAP &amp; DIRECTIONS</h3>
                            <iframe width="260" height="280" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=<%# Eval("property_location")%>&output=embed"></iframe>
                        </div>
                     </div>
                </ItemTemplate>
            </asp:ListView>

            <div class="large-4 column">
                <div class="agent">
                    <h3>CONTACT AGENT</h3>
                    <asp:ListView ID="ListView5" runat="server" DataSourceID="SqlDataSource3">
                        <ItemTemplate>
                            <img src="<%# Eval("agentPhoto")%>" />
                            <h4><%# Eval("agentname")%> <%# Eval("agentSurname")%> </h4>
                            <h5><span>Call:</span><%# Eval("agentPhone")%></h5>
                            <h5><span>Company:</span><%# Eval("agentCompany")%></h5>
                        </ItemTemplate>
                    </asp:ListView>
                </div>
            </div>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:gozoFarmhouses2 %>" ProviderName="<%$ ConnectionStrings:gozoFarmhouses2.ProviderName %>" SelectCommand="SELECT * FROM PropertyAgentQuery WHERE ([ID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
           
            <div class="large-4 column">
                <div class="rating">
                    <h3>RATE THIS RENTAL</h3>
                    <ajaxToolkit:Rating ID="Rating1" runat="server" StarCssClass="Star" FilledStarCssClass="Filled" EmptyStarCssClass="Empty" WaitingStarCssClass="Waiting"></ajaxToolkit:Rating>
                    <asp:Button ID="Button1" runat="server" Text="Submit" CausesValidation="False" UseSubmitBehavior="False" ValidateRequestMode="Disabled" />
                </div>
            </div>
            

            <div class="large-4 column">
                <div class="related">
                    <h3>RELATED RENTALS</h3>
                    <ul>
                        <asp:ListView ID="ListView4" runat="server" DataSourceID="SqlDataSource2">
                            <ItemTemplate>
                                <li>
                                   <a href="propertyDetail.aspx?id=<%# Eval("id")%>">
                                        <img src="<%# Eval("property_image_1")%>" alt="<%# Eval("property_name")%>" title="<%# Eval("property_name")%>"/>
                                        <div><h4><%# Eval("property_name")%></h4> </div>
                                   </a>
                                   
                                </li>
                            </ItemTemplate>
                        </asp:ListView> 
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:gozoFarmhouses2 %>" ProviderName="<%$ ConnectionStrings:gozoFarmhouses2.ProviderName %>" SelectCommand="SELECT TOP 2 Properties.* FROM Properties  WHERE ([ID] <> ?)">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </ul>
                </div>
            </div>


            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:gozoFarmhouses2 %>" ProviderName="<%$ ConnectionStrings:gozoFarmhouses2.ProviderName %>" SelectCommand="SELECT DISTINCT * FROM [Properties] WHERE ([ID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>


                    <asp:ListView ID="ListView6" runat="server" DataSourceID="SqlDataSource5">
                        <ItemTemplate>
                            <div class="large-8 column"> 
                                <div class="rated">
                                    <h2>Rated <span><%# Eval("AverageRating")%></span>/5</h2>
                                 </div>
                            </div>
                        </ItemTemplate>
                    </asp:ListView>
              

            <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:gozoFarmhouses2 %>" ProviderName="<%$ ConnectionStrings:gozoFarmhouses2.ProviderName %>" SelectCommand="SELECT * FROM [AverageRating] WHERE ([PropertyID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>

            <!-- Start of Comments -->
            <div class="large-8 column"> 
                <div class="comments">
                    <h2>Comments:</h2>
                            
                    <ul>
                        <asp:ListView ID="ListView3" runat="server">
                            <ItemTemplate>
                                <li>
                                    <div class="top">
                                        <span><%# Eval("Author")%></span> said on: <span><%# Eval("Comment_Date")%></span>
                                    </div>
                                    <p><%# Eval("Comment")%></p>
                                </li>
                            </ItemTemplate>
                        </asp:ListView>   
                                
                    </ul>
                </div>
            </div>
            <!-- End of Comments -->

            <!-- Start of Comments Form-->
            <div class="large-12 column">
                <div class="row">
                    <div class="large-8 column">
                        <div class="commentsForm">
                            <h2>Add a Comment:</h2>
                            <label>Author:</label>
                            <asp:TextBox ID="author" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="This Field is Required" ControlToValidate="author" CssClass="error"></asp:RequiredFieldValidator>
                            <label>Comment:</label>
                            <textarea id="comment" cols="20" rows="2" runat="server"></textarea>
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="This Field is Required" ControlToValidate="comment" CssClass="error"></asp:RequiredFieldValidator>
                            <asp:Button ID="addComment" runat="server" Text="Submit"/>
                        </div>
                    </div>
                </div>
            </div>
            <!-- End of Comments Form-->

        </div>
    </section>

</asp:Content>
